<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #canvas{
      border: 1px solid black;
    }
  </style>
</head>
<body>
  <canvas id="canvas"></canvas>

  <script>
    //默认宽高300*150
    const canvas = document.getElementById("canvas");
    let ctx = canvas.getContext("2d");
    console.log(ctx);
    //绘制圆  前两个参数为圆心位置  第三个是半径长度   4 起始画的位置 0就是 5 画的弧度
    ctx.arc(100,70,50,Math.PI/4,Math.PI);
    //描边颜色
    ctx.strokeStyle = "red";
    //宽度
    ctx.lineWidth =10
    //描边,渲染路径
    ctx.stroke()
  </script>
</body>
</html>